feat(wasm-utxo): improve BIP32 implementation with private key support#133
Merged
OttoAllmendinger merged 3 commits intomasterfrom Feb 4, 2026
Merged
feat(wasm-utxo): improve BIP32 implementation with private key support#133OttoAllmendinger merged 3 commits intomasterfrom
OttoAllmendinger merged 3 commits intomasterfrom
Conversation
…perties Enhanced BIP32.from_bip32_properties to properly handle private keys when converting from JavaScript BIP32 interfaces. Added optional buffer field utility function to safely extract private key data when present. Tests confirm proper handling of both xpub and xprv conversions with complete feature parity between WASM and utxolib implementations. Issue: BTC-2650 Co-authored-by: llm-git <llm-git@ttll.de>
Introduce a type-safe `Bytes<N>` wrapper for fixed-size byte arrays that implements TryFromJsValue. Replace direct buffer access with this cleaner approach in the BIP32 implementation. Issue: BTC-2650 Co-authored-by: llm-git <llm-git@ttll.de>
Refactors BIP32 tests to improve readability and maintainability by: - Adding reusable test fixtures for common values - Creating helper functions for buffer comparison and validation - Consolidating redundant test assertions - Simplifying test structure with more consistent patterns - Improving organization of test cases Issue: BTC-2650 Co-authored-by: llm-git <llm-git@ttll.de>
412fac0 to
fa78f4b
Compare
davidkaplanbitgo
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enhances the WASM-UTXO BIP32 implementation with several key
improvements:
Added support for private key handling in BIP32.from_bip32_properties,
enabling proper conversion from JavaScript BIP32 interfaces for both
xpub and xprv formats
Refactored byte array handling with a type-safe
Bytes<N>wrapperthat implements TryFromJsValue, replacing direct buffer access with
a cleaner approach
Improved BIP32 tests with reusable fixtures, helper functions, and
a more consistent organization pattern for better maintainability
These changes ensure complete feature parity between WASM and utxolib
implementations while improving code quality and type safety.
Reference: BTC-2650